/* eslint-disable no-nested-ternary */
import React, { ReactNode } from 'react';

import cn from 'classnames';

import s from './Validated.module.scss';

type Props = {
  children: ReactNode;
  className?: string;
  isPasswordField?: boolean;
};

export const Validated = ({ children, className, isPasswordField }: Props) => (
  <div
    className={cn(
      s.validated,
      {
        [s.isPassword]: isPasswordField,
      },
      className,
    )}
  >
    {children}
  </div>
);
